CC := g++
AR := ar
RANLIB := ranlib
MAKE := make

BINDIR := bin

LIBEXT := .a
LIBPREFIX := lib

ifdef LIB
LIBFILE := $(TOP)/$(BINDIR)/$(LIBPREFIX)$(LIB)$(LIBEXT)
endif 

SUMOPATH := /home/godinho/work/SUMO

.PHONY: clean subdirs $(LIBFILE)

%.o: %.cpp 
	$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
	
$(LIBFILE): $(OBJECTS)
	$(AR) rcs $(LIBFILE) $(OBJECTS)
	$(RANLIB) $(LIBFILE)

prop:
	$(call $TARGET)
	@for dir in $(SUBDIRS); do \
		$(MAKE) -C $$dir prop TARGET=$(TARGET); \
	done
	
clean:
ifdef OBJECTS
	rm -f $(OBJECTS)
endif
 
ifdef LIB
	rm -f $(LIBFILE);
endif
	rm -f $(EXE)
